maintainer="mekyt <hello@mek.yt>"
pkgname=lefthook
pkgver=1.8.0
pkgrel=0
pkgdesc="Fast and powerful Git hooks manager"
url="https://github.com/evilmartians/lefthook"
license="MIT"
arch="all"
subpackages="$pkgname-doc"
makedepends="go"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/evilmartians/lefthook/archive/v$pkgver.tar.gz
"
options="net" # download Go modules

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -ldflags "-s -w -X main.version=$pkgver"
}

check() {
	# Auto-update only avaiable for x86_64 and aarch64 arch
	go test  ./... -skip TestUpdater_SelfUpdate
}

package() {
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -Dm755 lefthook -t "$pkgdir"/usr/bin/
}

sha512sums="
ce47f8ffa770b939d25882a02289f86d602ab4a5be6910fe30a33de4665bb985f9f896bd0989ec7d11745e518dd6dd35334e58e564987125708d1723b3dd6cf6  lefthook-1.8.0.tar.gz
"
